# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse do
  @moduledoc """
  Response message for CrawlRateManagementService.ObtainCrawlRate method. The response contains organcic or dedicated crawl rate time series data for monitoring, depending on whether dedicated crawl rate is set.

  ## Attributes

  *   `dedicatedCrawlRateTimeSeries` (*type:* `GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries.t`, *default:* `nil`) - The historical dedicated crawl rate timeseries data, used for monitoring.
  *   `error` (*type:* `GoogleApi.DiscoveryEngine.V1beta.Model.GoogleRpcStatus.t`, *default:* `nil`) - Errors from service when handling the request.
  *   `organicCrawlRateTimeSeries` (*type:* `GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries.t`, *default:* `nil`) - The historical organic crawl rate timeseries data, used for monitoring.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the response.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dedicatedCrawlRateTimeSeries =>
            GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries.t()
            | nil,
          :error => GoogleApi.DiscoveryEngine.V1beta.Model.GoogleRpcStatus.t() | nil,
          :organicCrawlRateTimeSeries =>
            GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries.t()
            | nil,
          :state => String.t() | nil
        }

  field(:dedicatedCrawlRateTimeSeries,
    as:
      GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries
  )

  field(:error, as: GoogleApi.DiscoveryEngine.V1beta.Model.GoogleRpcStatus)

  field(:organicCrawlRateTimeSeries,
    as:
      GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries
  )

  field(:state)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
